<h3>{{params.title|typeFilter}}</h3>

<form name="myForm" method="post" action="localhost">
    <div>
        <label>Id:
            <input type="number" name="myId" ng-model="model.id"  /></label>
    </div>
    <div>
        <label>Name:
            <input type="text" name="myName" ng-model="model.name" required ng-minlength="3" ng-maxlength="6" /></label>
    </div>
    <div>
        <label>Email:
            <input  type="email" name="myEmail" ng-model="model.email" autocomplete="on"/></label>
            <span ng-show="myForm.myEmail.$invalid">错误</span>
            <span ng-show="myForm.myEmail.$valid">正确</span>
    </div>
    <div>
        <button type="submit" ng-disabled="myForm.$invalid">Save</button>
    </div>
</form>

<button ng-click="add()">addMemery()</button>
<!--angular内置表单验证，规则：表单name.文本框name-->

<!--没有文本框name，默认是整个表单-->
<!--表单是否通过验证:true通过，false不通过-->
<p>myForm.$valid: {{myForm.$valid}}</p>
<!--表单是否通过验证:true不通过，false通过-->
<p>myForm.$invalid: {{myForm.$invalid}}</p>
<!--表单是否被修改过：true没有，false修改过-->
<p>myForm.$pristine: {{myForm.$pristine}}</p>
<!--表单值是否被修改过：true修改过，false没有修改过-->
<p>myForm.$dirty: {{myForm.$dirty}}</p>

<!--加上name可以针对指定的做判断-->
<ul>
    <li>myForm.myEmail.$valid {{myForm.myEmail.$valid}}</li>
    <li>myForm.myEmail.$error {{myForm.myEmail.$error}}</li>
</ul>



